<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
        <script src="js/core.js">
        </script >
		<script src="jquery-1.4.2.js"></script>
        <script type="text/javascript">
 			var json={'acount':'xdcarter@163.com','passwd':'asdfasdf'};
			var sizeList='';
			var contentList='';
			function getNewSubmitForm(){
				$('#submitDiv').empty()
				$('#submitDiv').append('<form id="submitForm" method="post"></form>')
			}
			
			//helper function to add elements to the form
			function createNewFormElement(type, elementName, elementValue){
			     $('#submitForm').append('<input  type="'+type+'" value="'+elementValue+'" name="'+elementName+'"></input>')
				 
			}
			
			function setAction(name){
				$('#submitForm').attr('action',name+'.do');
			}
			
		 
            function json2str(json){
				for (var key in json) {
					if (json[key].constructor == Object) {
						json2str(json[key]);
					}
					else {
						sizeList += json[key].length + ',';
						contentList += json[key];
					}
					
				}
				
			}
			function encodeParams(params){
				for (var i=0;i<params.length;i++) {
					if (params[i].constructor == Object) {
						json2str(json[key]);
					}
					else {
						sizeList += params[i].length + ',';
						contentList += params[i];
					}					 	 
				}	
				return sizeList.length+':'+sizeList+contentList;			
			}
			function submit(name,params){
				getNewSubmitForm();
				setAction(name);
				createNewFormElement('text','json',encodeParams(params));
				$('#submitForm').submit();
				
				
			}
			function logon(){
				submit(arguments.callee.toString().match(/^\s*function\s(\w+)/)[1],arguments);
			}
        </script >		


</head>
<body>
	acount:<input id="acount" type="text"><br>
	passwd<input id="passwd" type="text"><br>
	<input type="button" onclick="logon($('#acount').val(),$('#passwd').val());" value="��½">
<div id="submitDiv" style="display:none;">
	<form id=""submitForm></form> 
	<input  type="text"  value=></input>
</div>
</body>
</html>